Feature: Profile Management
  The personal profile function group contains functions for creating and editing profiles,
  also including modification of credentials, skill sets and personal avatars.

  Background:
    Given i am logged in

  Scenario: Redirection To Profile Editing
    Given i logged in for the first time
    Then i should be redirected to the profile editing page

  Scenario: Edit Profile
    Given i choose to edit my profile
    When i update my profile data
    Then users should view my new profile data
    And the system should send me a notification alert "Profile Edited Successfully"

  Scenario Outline: Edit Profile, With Wrong Data
    Given i choose to edit my profile
    When i update my profile data
    But my profile <type> was not valid
    Then users should not view my new profile data
    And the system should send me an error notification "<error>"
  Examples:
    | type     | error                                                     |
    | email    | The email was not valid. Email not updated.               |
    | desc     | The description was not valid. Description not updated.   |
    | username | The username was not valid. Username not updated.         |
    | password | The password was not valid. Password not updated.         |
    | avatar   | The avatar image is not valid.                            |

  Scenario: Edit Other User Profile
    Given I am a super user
    And i choose to update foo's profile
    When i update foo's profile data
    Then users should view foo's new profile data
    And the system should send me a notification alert "Foo's Profile Edited Successful"


  Scenario Outline: Edit Other's Profile, With Wrong Data
    Given i am a super user
    And i choose to update foo's profile
    When i update foo's profile datas
    But foo's profile <type> was not valid
    Then users should not view foo's new profile data
    And the system should send me an error notification "<error>"
  Examples:
    | type     | error                                                     |
    | email    | The email was not valid. Email not updated.               |
    | desc     | The description was not valid. Description not updated.   |
    | username | The username was not valid. Username not updated.         |
    | password | The password was not valid. Password not updated.         |
    | avatar   | the avatar image is not valid.                            |

  Scenario Outline: Upload A File (Avatar) Successfully
    Given i fill the upload form with <filename> with myme <mymetype> and dimension <dimension>
    When i click on the upload button
    Then the system should send me a notification alert "File <filename> successfully uploaded"
    And i should receive a link to the uploaded file
  Examples:
    | mymetype | filename | dimension |
    | ex/1     | foo.bar  | tanto     |

  Scenario Outline: Upload A File Unsuccessfully
    Given i fill the upload form with <filename> with myme <mymetype> and dimension <dimension>
    When i click on the upload button
    Then the system should send me an error notification "File <filename> not uploaded. <error>"
  Examples:
    | mymetype | filename | dimension | error |
    | ex/1     | foo.bar  | tanto     | tipo di errore |
